package com.qzsoft.zhjd.server.modules.luzhong.exp.controller;

import com.qzsoft.zhjd.server.common.utils.R;
import com.qzsoft.zhjd.server.modules.luzhong.exp.entity.ZhenRuDuEntity;
import com.qzsoft.zhjd.server.modules.luzhong.exp.service.ZhenRuDuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 功能描述:鲁东针入度试验数据采集结构
 * @author : liugf
 * @date : 2021/4/15 14:54
 */
@Slf4j
@RestController
@RequestMapping("luzhong/exp/zhenrudu")
public class ZhenRuDuController {

    @Autowired
    private ZhenRuDuService zhenRuDuService;

    /**
     * 功能描述:接受针入度试验数据
     * @param entity 针入度试验实体
     * @return : cn.qzsoft.collect.server.common.utils.R
     * @author : liugf
     * @date : 2021/4/16 9:16
     */
    @PostMapping("save")
    public R save(@RequestBody ZhenRuDuEntity entity){
        log.info("针入度试验："+entity.toString());
        if(zhenRuDuService.saveOrUpdate(entity)){
            return R.ok();
        }else{
            return R.error("针入度试验接受成功");
        }
    }

}
